from Crypto.Util.number import *


def gcd(a, b):
    if (b == 0):
        return a
    else:
        return gcd(b, a % b)


s = [699175025435513913222265085178805479192132631113784770123757454808149151697608216361550466652878,
     193316257467202036043918706856603526262215679149886976392930192639917920593706895122296071643390,
     1624937780477561769577140419364339298985292198464188802403816662221142156714021229977403603922943,
     659236391930254891621938248429619132720452597526316230221895367798170380093631947248925278766506,
     111407194162820942281872438978366964960570302720229611594374532025973998885554449685055172110829,
     1415787594624585063605356859393351333923892058922987749824214311091742328340293435914830175796909,
     655057648553921580727111809001898496375489870757705297406250204329094679858718932270475755075698,
     1683427135823894785654993254138434580152093609545092045940376086714124324274044014654085676620851,
     492953986125248558013838257810313149490245209968714980288031443714890115686764222999717055064509,
     70048773361068060773257074705619791938224397526269544533030294499007242937089146507674570192265]

t = []
for i in range(9):
    t.append(s[i] - s[i - 1])
all_n = []
for i in range(7):
    all_n.append(gcd((t[i + 1] * t[i - 1] - t[i] * t[i]), (t[i + 2] * t[i] - t[i + 1] * t[i + 1])))

MMI = lambda A, n, s=1, t=0, N=0: (n < 2 and t % N or MMI(n, A % n, t, s - A // n * t, N or n), -1)[n < 1]  # 逆元计算
for n in all_n:
    n = abs(n)
    if n == 1:
        continue
    a = (s[2] - s[1]) * MMI((s[1] - s[0]), n) % n
    ani = MMI(a, n)
    b = (s[1] - a * s[0]) % n
    seed = (ani * (s[0] - b)) % n
    plaintext = seed
    print(long_to_bytes(plaintext))
